<?php

namespace app\api\validate;

use think\Validate;

class Address extends Validate
{
    protected $rule = [
        'phone' => 'require|mobile|number|length:11',
        'name' => 'require',
        'province' => 'require',
        'city' => 'require',
        'area' => 'require',
        'street' => '',
        'address' => 'require',
        'default' => 'require',
    ];

    protected $message  =   [
        'phone.require' => '手机号码必须输入',
        'phone.mobile' => '手机号码格式不正确',
        'phone.number'     => '手机号码只能是数字',
        'phone.length'     => '手机号码只能11位数字',
        'name' => '请填写收货人姓名',
        'province' => '请填写收货地址省份',
        'city' => '请填写收货地址城市',
        'area' => '请填写收货地址所在区域',
        'street' => '请填写收货地址所在街道',
        'address' => '请填写详细地址',
        'default' => '请选择是否设为默认地址',
    ];
}